package com.dyh.quickdemo.streamTest;

import org.junit.jupiter.api.Test;

import java.math.BigDecimal;


/*
@Author=Joey Wheeler
@Date=2021/3/12 18:22
*/
public class Mtest {

    @Test
    public void test2(){

        System.out.println(new BigDecimal(1).compareTo(BigDecimal.ZERO)>-1);
        System.out.println(new BigDecimal(0).compareTo(BigDecimal.ZERO));
        System.out.println(new BigDecimal(-1).compareTo(BigDecimal.ZERO));
        System.out.println(new BigDecimal(-2).compareTo(BigDecimal.ZERO));
        System.out.println(new BigDecimal(-2).compareTo(BigDecimal.ZERO)<0);
        System.out.println(new BigDecimal(0).compareTo(BigDecimal.ZERO)<0);
        System.out.println(new BigDecimal(1).compareTo(BigDecimal.ZERO));
    }


    @Test
    public void test(){
        (  (MySink.OfInt) System.out::println).accept(1);
      //  (  (MySink) System.out::println).accept(1);
     //   (  (MySink) System.out::println).accept(1L);
      //  fun(1,System.out::println);//会进入的是あ   int 需要单独出来 编译器无法识别
        fun(1L,System.out::println);//会进入的是い
    }

    public static void fun(int i,MySink mySink){
        mySink.accept(i);
    }
    /*あ*/
    public static void fun(int i, MySink.OfInt mySink){
        mySink.accept(i);
    }
    /*い*/
    public static void fun(long i, MySink.OfLong mySink){
        mySink.accept(i);
    }
}
